import { focusMarker } from '@/global'
import { searchInfo } from '@/views/home/SceneDisplay'
import { removePerson } from '@/views/home/StationLayout'
import { playStationAnimation } from '@/views/home/SceneDisplay/index'
let Pointlist: any = []
const OnEvent = async (e: {
	eventtype: string
	PropertyName?: string
	UserData?: string
	ObjectID?: string
	Id?: string
	GroupID?: string
	MouseClickPoint?: number[]
	Type?: string
}) => {
	console.log(e)

	// 判断是否为左键点击的交互
	if (e.eventtype === 'LeftMouseButtonClick') {
		console.log(e, 'LeftMouseButtonClick')
		Pointlist.push(e.MouseClickPoint)
		console.log('Pointlist', Pointlist)

		searchInfo(e)
		focusMarker(e)
		// playStationAnimation(e)
	}
	if (e.eventtype === 'CameraTourFinished') {
		console.log('导览播放结束')
	}
	if (e.eventtype === 'StartMoveFinished') {
		removePerson(e)
	}
}

export default OnEvent
